
//
//  HomeGoodsDetailRemarkView.m
//  FD
//
//  Created by xiaofang wang on 2018/11/19.
//  Copyright © 2018年 ZhiYuan Network. All rights reserved.
//
//备注
#import "HomeGoodsDetailRemarkView.h"
@interface HomeGoodsDetailRemarkView()
/**1.tips*/
@property (nonatomic, strong) UILabel *remarkLb;
/**2.线*/
@property (nonatomic, strong) UIView *lineView;
@end

@implementation HomeGoodsDetailRemarkView

#pragma mark - 一 init


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setupView];
        self.backgroundColor = [UIColor whiteColor];
    }
    return self;
}

- (void)setupView {

    [self addSubview:self.remarkLb];
    [self addSubview:self.lineView];
    [self addSubview:self.tf];
}



#pragma mark - 二 getter
- (UILabel *)remarkLb{
    if (!_remarkLb) {
        _remarkLb = [UILabel new];
        //国际化
        NSString *remark = NSLocalizedString(Order_Remark, @"备注:");
        _remarkLb.text = remark;
    }
    return _remarkLb;
}


//线
- (UIView *)lineView {
    if (!_lineView) {
        _lineView = [UIView new];
        _lineView.backgroundColor = [UIColor lightGrayColor];
    }
    return _lineView;
}

- (UITextField *)tf {
    if (!_tf) {
        _tf = [[UITextField alloc] init];
        //国际化
        NSString *remark = NSLocalizedString(Order_Remark, @"请输入备注");
        _tf.placeholder = remark;
    }
    return _tf;
}
#pragma mark - 三 layout

- (void)layoutSubviews {
    [super layoutSubviews];

    CGFloat k15 = 15;
    
    [self.remarkLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(k15);
        make.size.mas_equalTo(CGSizeMake(60, 30));
        make.top.equalTo(self.mas_top).offset(5);
    }];
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.remarkLb.mas_bottom);
        make.left.equalTo(self.mas_left).offset(k15);
        make.right.equalTo(self.mas_right).offset(-k15);
        make.height.equalTo(@0.8);
    }];
    
    [self.tf mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.lineView.mas_bottom).offset(5);
        make.left.equalTo(self.mas_left).offset(k15);
        make.right.equalTo(self.mas_right).offset(-k15);
        make.height.mas_equalTo(30);
    }];
}
#pragma mark - 四 init

@end
